{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [],
   "source": [
    "import csv\n",
    "import os\n",
    "\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import seaborn as sns\n",
    "import networkx as nx\n",
    "import pydot\n",
    "import graphviz\n",
    "from networkx.drawing.nx_pydot import graphviz_layout\n",
    "import matplotlib.pyplot as plt\n",
    "import random\n",
    "\n",
    "\n",
    "data_dir = '../data/'\n",
    "trace_data = os.path.join(data_dir, 'training_data', '2020_05_04', 'trace')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "filenames = os.listdir(trace_data)\n",
    "trace_df = [pd.read_csv(trace_data + os.sep + f) for f in filenames]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "traceIds = [df['traceId'].unique() for df in trace_df]    \n",
    "traceIds = np.unique(np.concatenate(traceIds))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>callType</th>\n",
       "      <th>startTime</th>\n",
       "      <th>elapsedTime</th>\n",
       "      <th>success</th>\n",
       "      <th>traceId</th>\n",
       "      <th>id</th>\n",
       "      <th>pid</th>\n",
       "      <th>cmdb_id</th>\n",
       "      <th>serviceName</th>\n",
       "      <th>dsName</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32193</th>\n",
       "      <td>OSB</td>\n",
       "      <td>1588525772094</td>\n",
       "      <td>213.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>c477e171db83ad3e1421</td>\n",
       "      <td>None</td>\n",
       "      <td>os_021</td>\n",
       "      <td>osb_001</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160955</th>\n",
       "      <td>CSF</td>\n",
       "      <td>1588525772109</td>\n",
       "      <td>185.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>2eac8171db83ad4c1423</td>\n",
       "      <td>c477e171db83ad3e1421</td>\n",
       "      <td>os_021</td>\n",
       "      <td>csf_001</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160955</th>\n",
       "      <td>RemoteProcess</td>\n",
       "      <td>1588525772110</td>\n",
       "      <td>183.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>2eac8171db83ad4c1423</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>csf_001</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32191</th>\n",
       "      <td>FlyRemote</td>\n",
       "      <td>1588525772113</td>\n",
       "      <td>5.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>2e8b1171db83ad518866</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>fly_remote_001</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160957</th>\n",
       "      <td>CSF</td>\n",
       "      <td>1588525772120</td>\n",
       "      <td>34.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>b6de1171db83ad588870</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>csf_002</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160957</th>\n",
       "      <td>RemoteProcess</td>\n",
       "      <td>1588525772123</td>\n",
       "      <td>30.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>f48df171db83ad5b7590</td>\n",
       "      <td>b6de1171db83ad588870</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>csf_002</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837371</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772141</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>5471a171db83ad6d7607</td>\n",
       "      <td>51a92171db83ad6d7604</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643767</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772141</td>\n",
       "      <td>6.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>51a92171db83ad6d7604</td>\n",
       "      <td>f48df171db83ad5b7590</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>local_method_011</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837373</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772145</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>2cbd2171db83ad717615</td>\n",
       "      <td>51a92171db83ad6d7604</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160960</th>\n",
       "      <td>CSF</td>\n",
       "      <td>1588525772156</td>\n",
       "      <td>29.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>97aa3171db83ad7b8874</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>csf_003</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160960</th>\n",
       "      <td>RemoteProcess</td>\n",
       "      <td>1588525772160</td>\n",
       "      <td>24.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>3026d171db83ad807620</td>\n",
       "      <td>97aa3171db83ad7b8874</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>csf_003</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643771</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772168</td>\n",
       "      <td>6.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>aba7d171db83ad887633</td>\n",
       "      <td>3026d171db83ad807620</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>local_method_013</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837378</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772168</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>6b83e171db83ad887636</td>\n",
       "      <td>aba7d171db83ad887633</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837380</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772171</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>28c35171db83ad8b7642</td>\n",
       "      <td>aba7d171db83ad887633</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643773</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772175</td>\n",
       "      <td>3.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>cb038171db83ad8f7649</td>\n",
       "      <td>3026d171db83ad807620</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>local_method_014</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837382</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772176</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>15a3f171db83ad907652</td>\n",
       "      <td>cb038171db83ad8f7649</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160963</th>\n",
       "      <td>CSF</td>\n",
       "      <td>1588525772188</td>\n",
       "      <td>30.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>f5a31171db83ad9c8880</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>csf_004</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160963</th>\n",
       "      <td>RemoteProcess</td>\n",
       "      <td>1588525772191</td>\n",
       "      <td>26.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>2b56b171db83ad9f7667</td>\n",
       "      <td>f5a31171db83ad9c8880</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>csf_004</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643775</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772196</td>\n",
       "      <td>7.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>d4a92171db83ada47674</td>\n",
       "      <td>2b56b171db83ad9f7667</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>local_method_015</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837385</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772196</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>666d9171db83ada47677</td>\n",
       "      <td>d4a92171db83ada47674</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837386</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772200</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>2487d171db83ada87682</td>\n",
       "      <td>d4a92171db83ada47674</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643777</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772205</td>\n",
       "      <td>4.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>c878a171db83adad7687</td>\n",
       "      <td>2b56b171db83ad9f7667</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>local_method_016</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837388</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772206</td>\n",
       "      <td>3.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>aa1e4171db83adae7690</td>\n",
       "      <td>c878a171db83adad7687</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160965</th>\n",
       "      <td>CSF</td>\n",
       "      <td>1588525772219</td>\n",
       "      <td>21.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>c05f7171db83adbb8884</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>csf_005</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>160965</th>\n",
       "      <td>RemoteProcess</td>\n",
       "      <td>1588525772221</td>\n",
       "      <td>18.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>4e123171db83adbd7702</td>\n",
       "      <td>c05f7171db83adbb8884</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>csf_005</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837391</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772226</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>0e309171db83adc27707</td>\n",
       "      <td>dee58171db83adc27704</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643779</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772226</td>\n",
       "      <td>8.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>dee58171db83adc27704</td>\n",
       "      <td>4e123171db83adbd7702</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>local_method_017</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837392</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772230</td>\n",
       "      <td>3.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>62c41171db83adc67710</td>\n",
       "      <td>dee58171db83adc27704</td>\n",
       "      <td>docker_006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_003</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837404</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772241</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>35890171db83add18917</td>\n",
       "      <td>19973171db83add18914</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643792</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772241</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>19973171db83add18914</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_001</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837406</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772242</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>c665a171db83add28925</td>\n",
       "      <td>19973171db83add18914</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643795</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772243</td>\n",
       "      <td>16.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>475ec171db83add38929</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_002</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837411</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772257</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>e7a12171db83ade18942</td>\n",
       "      <td>475ec171db83add38929</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643799</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772259</td>\n",
       "      <td>3.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>b4ce6171db83ade38947</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_002</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837414</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772261</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>53ee6171db83ade58955</td>\n",
       "      <td>b4ce6171db83ade38947</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643801</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772262</td>\n",
       "      <td>4.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>d64fa171db83ade68962</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_003</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837417</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772264</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>f47f9171db83ade88970</td>\n",
       "      <td>d64fa171db83ade68962</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643805</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772266</td>\n",
       "      <td>3.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>c80b4171db83adea8977</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_004</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837420</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772267</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>f16ae171db83adeb8985</td>\n",
       "      <td>c80b4171db83adea8977</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643806</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772269</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>376a0171db83aded8987</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_004</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837421</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772270</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>f6773171db83adee8990</td>\n",
       "      <td>376a0171db83aded8987</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643807</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772271</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>63c64171db83adef8992</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_004</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837423</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772272</td>\n",
       "      <td>0.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>8178b171db83adf08998</td>\n",
       "      <td>63c64171db83adef8992</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837424</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772273</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>21dd7171db83adf19003</td>\n",
       "      <td>7a182171db83adf19000</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643808</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772273</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>7a182171db83adf19000</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_004</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643809</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772274</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>37de7171db83adf29005</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_005</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837425</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772275</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>902b2171db83adf39008</td>\n",
       "      <td>37de7171db83adf29005</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643810</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772276</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>4aa69171db83adf49010</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_006</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837426</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772276</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>b036f171db83adf49013</td>\n",
       "      <td>4aa69171db83adf49010</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643811</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772277</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>f1c58171db83adf59015</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_007</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643812</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772278</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>8f443171db83adf69020</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_006</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837427</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772278</td>\n",
       "      <td>0.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>7033a171db83adf69018</td>\n",
       "      <td>f1c58171db83adf59015</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837428</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772279</td>\n",
       "      <td>0.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>a206b171db83adf79023</td>\n",
       "      <td>8f443171db83adf69020</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643813</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772280</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>88484171db83adf89025</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_009</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837429</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772281</td>\n",
       "      <td>0.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>c56a1171db83adf99028</td>\n",
       "      <td>88484171db83adf89025</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>643814</th>\n",
       "      <td>LOCAL</td>\n",
       "      <td>1588525772282</td>\n",
       "      <td>6.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>0e1f0171db83adf99030</td>\n",
       "      <td>54001171db83ad4e8862</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>local_method_010</td>\n",
       "      <td>db_007</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837430</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772282</td>\n",
       "      <td>2.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>9ff95171db83adfa9033</td>\n",
       "      <td>0e1f0171db83adf99030</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_007</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>837431</th>\n",
       "      <td>JDBC</td>\n",
       "      <td>1588525772285</td>\n",
       "      <td>3.0</td>\n",
       "      <td>True</td>\n",
       "      <td>dfa3f171db83ad3e1420</td>\n",
       "      <td>98069171db83adfd9036</td>\n",
       "      <td>0e1f0171db83adf99030</td>\n",
       "      <td>docker_004</td>\n",
       "      <td>NaN</td>\n",
       "      <td>db_007</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             callType      startTime  elapsedTime  success  \\\n",
       "32193             OSB  1588525772094        213.0     True   \n",
       "160955            CSF  1588525772109        185.0     True   \n",
       "160955  RemoteProcess  1588525772110        183.0     True   \n",
       "32191       FlyRemote  1588525772113          5.0     True   \n",
       "160957            CSF  1588525772120         34.0     True   \n",
       "160957  RemoteProcess  1588525772123         30.0     True   \n",
       "837371           JDBC  1588525772141          2.0     True   \n",
       "643767          LOCAL  1588525772141          6.0     True   \n",
       "837373           JDBC  1588525772145          2.0     True   \n",
       "160960            CSF  1588525772156         29.0     True   \n",
       "160960  RemoteProcess  1588525772160         24.0     True   \n",
       "643771          LOCAL  1588525772168          6.0     True   \n",
       "837378           JDBC  1588525772168          2.0     True   \n",
       "837380           JDBC  1588525772171          2.0     True   \n",
       "643773          LOCAL  1588525772175          3.0     True   \n",
       "837382           JDBC  1588525772176          2.0     True   \n",
       "160963            CSF  1588525772188         30.0     True   \n",
       "160963  RemoteProcess  1588525772191         26.0     True   \n",
       "643775          LOCAL  1588525772196          7.0     True   \n",
       "837385           JDBC  1588525772196          2.0     True   \n",
       "837386           JDBC  1588525772200          2.0     True   \n",
       "643777          LOCAL  1588525772205          4.0     True   \n",
       "837388           JDBC  1588525772206          3.0     True   \n",
       "160965            CSF  1588525772219         21.0     True   \n",
       "160965  RemoteProcess  1588525772221         18.0     True   \n",
       "837391           JDBC  1588525772226          2.0     True   \n",
       "643779          LOCAL  1588525772226          8.0     True   \n",
       "837392           JDBC  1588525772230          3.0     True   \n",
       "837404           JDBC  1588525772241          1.0     True   \n",
       "643792          LOCAL  1588525772241          2.0     True   \n",
       "837406           JDBC  1588525772242          1.0     True   \n",
       "643795          LOCAL  1588525772243         16.0     True   \n",
       "837411           JDBC  1588525772257          1.0     True   \n",
       "643799          LOCAL  1588525772259          3.0     True   \n",
       "837414           JDBC  1588525772261          1.0     True   \n",
       "643801          LOCAL  1588525772262          4.0     True   \n",
       "837417           JDBC  1588525772264          1.0     True   \n",
       "643805          LOCAL  1588525772266          3.0     True   \n",
       "837420           JDBC  1588525772267          1.0     True   \n",
       "643806          LOCAL  1588525772269          2.0     True   \n",
       "837421           JDBC  1588525772270          1.0     True   \n",
       "643807          LOCAL  1588525772271          2.0     True   \n",
       "837423           JDBC  1588525772272          0.0     True   \n",
       "837424           JDBC  1588525772273          1.0     True   \n",
       "643808          LOCAL  1588525772273          1.0     True   \n",
       "643809          LOCAL  1588525772274          2.0     True   \n",
       "837425           JDBC  1588525772275          1.0     True   \n",
       "643810          LOCAL  1588525772276          1.0     True   \n",
       "837426           JDBC  1588525772276          1.0     True   \n",
       "643811          LOCAL  1588525772277          1.0     True   \n",
       "643812          LOCAL  1588525772278          2.0     True   \n",
       "837427           JDBC  1588525772278          0.0     True   \n",
       "837428           JDBC  1588525772279          0.0     True   \n",
       "643813          LOCAL  1588525772280          1.0     True   \n",
       "837429           JDBC  1588525772281          0.0     True   \n",
       "643814          LOCAL  1588525772282          6.0     True   \n",
       "837430           JDBC  1588525772282          2.0     True   \n",
       "837431           JDBC  1588525772285          3.0     True   \n",
       "\n",
       "                     traceId                    id                   pid  \\\n",
       "32193   dfa3f171db83ad3e1420  c477e171db83ad3e1421                  None   \n",
       "160955  dfa3f171db83ad3e1420  2eac8171db83ad4c1423  c477e171db83ad3e1421   \n",
       "160955  dfa3f171db83ad3e1420  54001171db83ad4e8862  2eac8171db83ad4c1423   \n",
       "32191   dfa3f171db83ad3e1420  2e8b1171db83ad518866  54001171db83ad4e8862   \n",
       "160957  dfa3f171db83ad3e1420  b6de1171db83ad588870  54001171db83ad4e8862   \n",
       "160957  dfa3f171db83ad3e1420  f48df171db83ad5b7590  b6de1171db83ad588870   \n",
       "837371  dfa3f171db83ad3e1420  5471a171db83ad6d7607  51a92171db83ad6d7604   \n",
       "643767  dfa3f171db83ad3e1420  51a92171db83ad6d7604  f48df171db83ad5b7590   \n",
       "837373  dfa3f171db83ad3e1420  2cbd2171db83ad717615  51a92171db83ad6d7604   \n",
       "160960  dfa3f171db83ad3e1420  97aa3171db83ad7b8874  54001171db83ad4e8862   \n",
       "160960  dfa3f171db83ad3e1420  3026d171db83ad807620  97aa3171db83ad7b8874   \n",
       "643771  dfa3f171db83ad3e1420  aba7d171db83ad887633  3026d171db83ad807620   \n",
       "837378  dfa3f171db83ad3e1420  6b83e171db83ad887636  aba7d171db83ad887633   \n",
       "837380  dfa3f171db83ad3e1420  28c35171db83ad8b7642  aba7d171db83ad887633   \n",
       "643773  dfa3f171db83ad3e1420  cb038171db83ad8f7649  3026d171db83ad807620   \n",
       "837382  dfa3f171db83ad3e1420  15a3f171db83ad907652  cb038171db83ad8f7649   \n",
       "160963  dfa3f171db83ad3e1420  f5a31171db83ad9c8880  54001171db83ad4e8862   \n",
       "160963  dfa3f171db83ad3e1420  2b56b171db83ad9f7667  f5a31171db83ad9c8880   \n",
       "643775  dfa3f171db83ad3e1420  d4a92171db83ada47674  2b56b171db83ad9f7667   \n",
       "837385  dfa3f171db83ad3e1420  666d9171db83ada47677  d4a92171db83ada47674   \n",
       "837386  dfa3f171db83ad3e1420  2487d171db83ada87682  d4a92171db83ada47674   \n",
       "643777  dfa3f171db83ad3e1420  c878a171db83adad7687  2b56b171db83ad9f7667   \n",
       "837388  dfa3f171db83ad3e1420  aa1e4171db83adae7690  c878a171db83adad7687   \n",
       "160965  dfa3f171db83ad3e1420  c05f7171db83adbb8884  54001171db83ad4e8862   \n",
       "160965  dfa3f171db83ad3e1420  4e123171db83adbd7702  c05f7171db83adbb8884   \n",
       "837391  dfa3f171db83ad3e1420  0e309171db83adc27707  dee58171db83adc27704   \n",
       "643779  dfa3f171db83ad3e1420  dee58171db83adc27704  4e123171db83adbd7702   \n",
       "837392  dfa3f171db83ad3e1420  62c41171db83adc67710  dee58171db83adc27704   \n",
       "837404  dfa3f171db83ad3e1420  35890171db83add18917  19973171db83add18914   \n",
       "643792  dfa3f171db83ad3e1420  19973171db83add18914  54001171db83ad4e8862   \n",
       "837406  dfa3f171db83ad3e1420  c665a171db83add28925  19973171db83add18914   \n",
       "643795  dfa3f171db83ad3e1420  475ec171db83add38929  54001171db83ad4e8862   \n",
       "837411  dfa3f171db83ad3e1420  e7a12171db83ade18942  475ec171db83add38929   \n",
       "643799  dfa3f171db83ad3e1420  b4ce6171db83ade38947  54001171db83ad4e8862   \n",
       "837414  dfa3f171db83ad3e1420  53ee6171db83ade58955  b4ce6171db83ade38947   \n",
       "643801  dfa3f171db83ad3e1420  d64fa171db83ade68962  54001171db83ad4e8862   \n",
       "837417  dfa3f171db83ad3e1420  f47f9171db83ade88970  d64fa171db83ade68962   \n",
       "643805  dfa3f171db83ad3e1420  c80b4171db83adea8977  54001171db83ad4e8862   \n",
       "837420  dfa3f171db83ad3e1420  f16ae171db83adeb8985  c80b4171db83adea8977   \n",
       "643806  dfa3f171db83ad3e1420  376a0171db83aded8987  54001171db83ad4e8862   \n",
       "837421  dfa3f171db83ad3e1420  f6773171db83adee8990  376a0171db83aded8987   \n",
       "643807  dfa3f171db83ad3e1420  63c64171db83adef8992  54001171db83ad4e8862   \n",
       "837423  dfa3f171db83ad3e1420  8178b171db83adf08998  63c64171db83adef8992   \n",
       "837424  dfa3f171db83ad3e1420  21dd7171db83adf19003  7a182171db83adf19000   \n",
       "643808  dfa3f171db83ad3e1420  7a182171db83adf19000  54001171db83ad4e8862   \n",
       "643809  dfa3f171db83ad3e1420  37de7171db83adf29005  54001171db83ad4e8862   \n",
       "837425  dfa3f171db83ad3e1420  902b2171db83adf39008  37de7171db83adf29005   \n",
       "643810  dfa3f171db83ad3e1420  4aa69171db83adf49010  54001171db83ad4e8862   \n",
       "837426  dfa3f171db83ad3e1420  b036f171db83adf49013  4aa69171db83adf49010   \n",
       "643811  dfa3f171db83ad3e1420  f1c58171db83adf59015  54001171db83ad4e8862   \n",
       "643812  dfa3f171db83ad3e1420  8f443171db83adf69020  54001171db83ad4e8862   \n",
       "837427  dfa3f171db83ad3e1420  7033a171db83adf69018  f1c58171db83adf59015   \n",
       "837428  dfa3f171db83ad3e1420  a206b171db83adf79023  8f443171db83adf69020   \n",
       "643813  dfa3f171db83ad3e1420  88484171db83adf89025  54001171db83ad4e8862   \n",
       "837429  dfa3f171db83ad3e1420  c56a1171db83adf99028  88484171db83adf89025   \n",
       "643814  dfa3f171db83ad3e1420  0e1f0171db83adf99030  54001171db83ad4e8862   \n",
       "837430  dfa3f171db83ad3e1420  9ff95171db83adfa9033  0e1f0171db83adf99030   \n",
       "837431  dfa3f171db83ad3e1420  98069171db83adfd9036  0e1f0171db83adf99030   \n",
       "\n",
       "           cmdb_id       serviceName  dsName  \n",
       "32193       os_021           osb_001     NaN  \n",
       "160955      os_021           csf_001     NaN  \n",
       "160955  docker_004           csf_001     NaN  \n",
       "32191   docker_004    fly_remote_001     NaN  \n",
       "160957  docker_004           csf_002     NaN  \n",
       "160957  docker_006           csf_002     NaN  \n",
       "837371  docker_006               NaN  db_003  \n",
       "643767  docker_006  local_method_011  db_003  \n",
       "837373  docker_006               NaN  db_003  \n",
       "160960  docker_004           csf_003     NaN  \n",
       "160960  docker_006           csf_003     NaN  \n",
       "643771  docker_006  local_method_013  db_003  \n",
       "837378  docker_006               NaN  db_003  \n",
       "837380  docker_006               NaN  db_003  \n",
       "643773  docker_006  local_method_014  db_003  \n",
       "837382  docker_006               NaN  db_003  \n",
       "160963  docker_004           csf_004     NaN  \n",
       "160963  docker_006           csf_004     NaN  \n",
       "643775  docker_006  local_method_015  db_003  \n",
       "837385  docker_006               NaN  db_003  \n",
       "837386  docker_006               NaN  db_003  \n",
       "643777  docker_006  local_method_016  db_003  \n",
       "837388  docker_006               NaN  db_003  \n",
       "160965  docker_004           csf_005     NaN  \n",
       "160965  docker_006           csf_005     NaN  \n",
       "837391  docker_006               NaN  db_003  \n",
       "643779  docker_006  local_method_017  db_003  \n",
       "837392  docker_006               NaN  db_003  \n",
       "837404  docker_004               NaN  db_009  \n",
       "643792  docker_004  local_method_001  db_009  \n",
       "837406  docker_004               NaN  db_009  \n",
       "643795  docker_004  local_method_002  db_009  \n",
       "837411  docker_004               NaN  db_009  \n",
       "643799  docker_004  local_method_002  db_009  \n",
       "837414  docker_004               NaN  db_009  \n",
       "643801  docker_004  local_method_003  db_009  \n",
       "837417  docker_004               NaN  db_009  \n",
       "643805  docker_004  local_method_004  db_009  \n",
       "837420  docker_004               NaN  db_009  \n",
       "643806  docker_004  local_method_004  db_009  \n",
       "837421  docker_004               NaN  db_009  \n",
       "643807  docker_004  local_method_004  db_009  \n",
       "837423  docker_004               NaN  db_009  \n",
       "837424  docker_004               NaN  db_009  \n",
       "643808  docker_004  local_method_004  db_009  \n",
       "643809  docker_004  local_method_005  db_009  \n",
       "837425  docker_004               NaN  db_009  \n",
       "643810  docker_004  local_method_006  db_009  \n",
       "837426  docker_004               NaN  db_009  \n",
       "643811  docker_004  local_method_007  db_009  \n",
       "643812  docker_004  local_method_006  db_009  \n",
       "837427  docker_004               NaN  db_009  \n",
       "837428  docker_004               NaN  db_009  \n",
       "643813  docker_004  local_method_009  db_009  \n",
       "837429  docker_004               NaN  db_009  \n",
       "643814  docker_004  local_method_010  db_007  \n",
       "837430  docker_004               NaN  db_007  \n",
       "837431  docker_004               NaN  db_007  "
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# columns=['startTime','elapsedTime','success','traceId','id','pid','cmdb_id','serviceName','dsName','callType']\n",
    "\n",
    "##############\n",
    "traceId = np.random.choice(traceIds) # Test for now\n",
    "##############\n",
    "\n",
    "single_trace = pd.concat([df[df['traceId'] == traceId] for df in trace_df])\n",
    "single_trace.sort_values(by='startTime', inplace=True)\n",
    "single_trace.head(100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [],
   "source": [
    "def preprocess_trace(df):\n",
    "    pass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "59\n",
      "58\n"
     ]
    }
   ],
   "source": [
    "G = nx.Graph()\n",
    "G = nx.from_pandas_edgelist(single_trace, \n",
    "    source='pid', \n",
    "    target='id', \n",
    "    edge_attr=True,\n",
    "#     create_using=nx.DiGraph()\n",
    ")\n",
    "\n",
    "print(len(list(G.nodes)))\n",
    "print(len(list(G.edges)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    }
   ],
   "source": [
    "# Check if the current trace is a tree (should be)\n",
    "print(nx.is_tree(G))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [],
   "source": [
    "def hierarchy_pos(G, root=None, width=1., vert_gap = 0.2, vert_loc = 0, leaf_vs_root_factor = 0.5):\n",
    "\n",
    "    '''\n",
    "    If the graph is a tree this will return the positions to plot this in a \n",
    "    hierarchical layout.\n",
    "    \n",
    "    Based on Joel's answer at https://stackoverflow.com/a/29597209/2966723,\n",
    "    but with some modifications.  \n",
    "\n",
    "    We include this because it may be useful for plotting transmission trees,\n",
    "    and there is currently no networkx equivalent (though it may be coming soon).\n",
    "    \n",
    "    There are two basic approaches we think of to allocate the horizontal \n",
    "    location of a node.  \n",
    "    \n",
    "    - Top down: we allocate horizontal space to a node.  Then its ``k`` \n",
    "      descendants split up that horizontal space equally.  This tends to result\n",
    "      in overlapping nodes when some have many descendants.\n",
    "    - Bottom up: we allocate horizontal space to each leaf node.  A node at a \n",
    "      higher level gets the entire space allocated to its descendant leaves.\n",
    "      Based on this, leaf nodes at higher levels get the same space as leaf\n",
    "      nodes very deep in the tree.  \n",
    "      \n",
    "    We use use both of these approaches simultaneously with ``leaf_vs_root_factor`` \n",
    "    determining how much of the horizontal space is based on the bottom up \n",
    "    or top down approaches.  ``0`` gives pure bottom up, while 1 gives pure top\n",
    "    down.   \n",
    "    \n",
    "    \n",
    "    :Arguments: \n",
    "    \n",
    "    **G** the graph (must be a tree)\n",
    "\n",
    "    **root** the root node of the tree \n",
    "    - if the tree is directed and this is not given, the root will be found and used\n",
    "    - if the tree is directed and this is given, then the positions will be \n",
    "      just for the descendants of this node.\n",
    "    - if the tree is undirected and not given, then a random choice will be used.\n",
    "\n",
    "    **width** horizontal space allocated for this branch - avoids overlap with other branches\n",
    "\n",
    "    **vert_gap** gap between levels of hierarchy\n",
    "\n",
    "    **vert_loc** vertical location of root\n",
    "    \n",
    "    **leaf_vs_root_factor**\n",
    "\n",
    "    xcenter: horizontal location of root\n",
    "    '''\n",
    "    if not nx.is_tree(G):\n",
    "        raise TypeError('cannot use hierarchy_pos on a graph that is not a tree')\n",
    "\n",
    "    if root is None:\n",
    "        if isinstance(G, nx.DiGraph):\n",
    "            root = next(iter(nx.topological_sort(G)))  #allows back compatibility with nx version 1.11\n",
    "        else:\n",
    "            root = random.choice(list(G.nodes))\n",
    "\n",
    "    def _hierarchy_pos(G, root, leftmost, width, leafdx = 0.2, vert_gap = 0.2, vert_loc = 0, \n",
    "                    xcenter = 0.5, rootpos = None, \n",
    "                    leafpos = None, parent = None):\n",
    "        '''\n",
    "        see hierarchy_pos docstring for most arguments\n",
    "\n",
    "        pos: a dict saying where all nodes go if they have been assigned\n",
    "        parent: parent of this branch. - only affects it if non-directed\n",
    "\n",
    "        '''\n",
    "\n",
    "        if rootpos is None:\n",
    "            rootpos = {root:(xcenter,vert_loc)}\n",
    "        else:\n",
    "            rootpos[root] = (xcenter, vert_loc)\n",
    "        if leafpos is None:\n",
    "            leafpos = {}\n",
    "        children = list(G.neighbors(root))\n",
    "        leaf_count = 0\n",
    "        if not isinstance(G, nx.DiGraph) and parent is not None:\n",
    "            children.remove(parent)  \n",
    "        if len(children)!=0:\n",
    "            rootdx = width/len(children)\n",
    "            nextx = xcenter - width/2 - rootdx/2\n",
    "            for child in children:\n",
    "                nextx += rootdx\n",
    "                rootpos, leafpos, newleaves = _hierarchy_pos(G,child, leftmost+leaf_count*leafdx, \n",
    "                                    width=rootdx, leafdx=leafdx,\n",
    "                                    vert_gap = vert_gap, vert_loc = vert_loc-vert_gap, \n",
    "                                    xcenter=nextx, rootpos=rootpos, leafpos=leafpos, parent = root)\n",
    "                leaf_count += newleaves\n",
    "\n",
    "            leftmostchild = min((x for x,y in [leafpos[child] for child in children]))\n",
    "            rightmostchild = max((x for x,y in [leafpos[child] for child in children]))\n",
    "            leafpos[root] = ((leftmostchild+rightmostchild)/2, vert_loc)\n",
    "        else:\n",
    "            leaf_count = 1\n",
    "            leafpos[root]  = (leftmost, vert_loc)\n",
    "#        pos[root] = (leftmost + (leaf_count-1)*dx/2., vert_loc)\n",
    "#        print(leaf_count)\n",
    "        return rootpos, leafpos, leaf_count\n",
    "\n",
    "    xcenter = width/2.\n",
    "    if isinstance(G, nx.DiGraph):\n",
    "        leafcount = len([node for node in nx.descendants(G, root) if G.out_degree(node)==0])\n",
    "    elif isinstance(G, nx.Graph):\n",
    "        leafcount = len([node for node in nx.node_connected_component(G, root) if G.degree(node)==1 and node != root])\n",
    "    rootpos, leafpos, leaf_count = _hierarchy_pos(G, root, 0, width, \n",
    "                                                    leafdx=width*1./leafcount, \n",
    "                                                    vert_gap=vert_gap, \n",
    "                                                    vert_loc = vert_loc, \n",
    "                                                    xcenter = xcenter)\n",
    "    pos = {}\n",
    "    for node in rootpos:\n",
    "        pos[node] = (leaf_vs_root_factor*leafpos[node][0] + (1-leaf_vs_root_factor)*rootpos[node][0], leafpos[node][1]) \n",
    "#    pos = {node:(leaf_vs_root_factor*x1+(1-leaf_vs_root_factor)*x2, y1) for ((x1,y1), (x2,y2)) in (leafpos[node], rootpos[node]) for node in rootpos}\n",
    "    xmax = max(x for x,y in pos.values())\n",
    "    for node in pos:\n",
    "        pos[node]= (pos[node][0]*width/xmax, pos[node][1])\n",
    "    return pos"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEuCAYAAADx63eqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAABUmElEQVR4nO3deUBU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lUWZmJm3fvp1Gjx5N1tbWFBwcTF999RX9999/RPT0+7xx4wZ9+eWXNGTIELK0tKSePXvSsmXL5JdNmeHhxMfqveLiYvr9999p4cKF1LFjR7KxsaHRo0fTd999R/fu3ZOXy87Opt27d9P48ePJ1taWevfuTWvWrKl04qyOWCymyMhI+WsI8+bNo5iYGKXaGR0dTUFBQRQYGEhHjhypU8/w119/JWdnZ/rqq6/qVP7dd9+lAQMG1HjCzcnJIWtr62of2hg5cmS1T4l+9913FBERoXDZlStXyMnJqdKL7uUePHhA3t7etGHDhirLnjx5QkOGDKHg4OAq79fl5ubKL03u3Lmz0j7Iz8+nlStXkqOjIwmFQvmlaqKnD81s2LCB2rRpQ127dqXdu3fLE2thYSHt2LGDgoODydnZmd566y15j7uoqIj2799PY8eOJWtraxo+fDjt3r2b8vPzqaioiH799VeaMWMGOTs7U4cOHej999+nS5cuydtVXFxMJ0+epHfeeYc6duxItra2NGbMGPr+++/lyZLVf5z4WL2j6Fd2UFCQwl/ZycnJ9O2331JoaChZWVnR8OHDacuWLZSenl6nWBVfQwgODq71NQRFrl27RmFhYeTl5UU7d+6stUdJ9PRS6OLFi8nDw4POnTtXpziRkZHUsmVLhZciK9q8eTONHj262uWhoaF0/PhxhcuSkpLIycmp2m1YsGABTZ8+XeGye/fukYeHB+3atavKMolEQu+99x55enrSxYsXqyy/ePEidezYkQYOHFjlJfzs7GxaunQp2dvb02uvvUYPHz6UL5NKpfTLL79QSEgIeXh40KefflrpoZrbt2/TokWLyNXVlXr16kVbt26Vv8yfm5tLO3fulI8WM378ePr555+puLiYJBIJnTt3jt555x1q27YteXh40CuvvEInTpwgsVgsr//hw4e0Y8cOioiIIGdnZ/nVh6ioqEpPwrL6hRMfqxcyMjJoz549NH36dHJ3d6eWLVvSyy+/TJGRkZVOZDKZjK5evUofffQRdenShRwcHGjatGn0888/Vxmqqzr5+fkkEonkryEsWrSo0ggldfXff/9RREQEubi40Nq1a+v8kvTDhw8pJCSEQkND6zzCyM2bN8nR0ZEuXbpUa9k+ffrQoUOHql3es2dP+uuvv6pd7u/vT//884/CZbm5ueTu7k5//vlnte10cXGp9D5fRYcOHSInJyfavHlzlWVlZWX02WefkYODA61cubJSgiEievToES1YsIDs7e1p0aJFVR5GiomJoYiICLKzs6PXXnutUgItLS2lqKgoGj58ONna2tKsWbPowoUL8p5cZmYmbdq0ST5azNSpU+nYsWPyXmR8fDytWrWKgoKCyNbWliZOnEh79+6tlNzK30mseL+5b9++9PHHH9M///xT6elXpl+c+JheiMViio6OrvQk3fDhw+nbb7+t8iRdWVkZ/fHHH/T666+Tl5cXtWrVit544w2Kjo6u8z0WmUxGFy9elL+GMHz48Dq9hqDI48ePaf78+WRvb0/Lli2rMnpLTc6cOUPu7u70wQcf1PlEmJOTQ23btqVt27bVWvbu3bvk6OhYJWlUFBgYWONoMm+++SZ99NFH1S7ft28ftW/fvtrH/v/9919ycnKSv57wrISEBPL396dZs2Yp/LGQmJhIQ4cOpfbt2yvsDScnJ8sfWlm+fHmV/Z+amkqLFi0iBwcHGj16NP3555+V/p8ePHhAK1eupNatW1P79u3pq6++qtSLTktLqzRazOzZs+n06dPy7ystLY02btxIYWFhZGVlRYMHD6YNGzZUGUqusLCQjh07Rm+88Qa1a9eO7O3tafz48bRlyxZKTk6uZu8yXeDEx3RCJpNVenfK2tpa/u7UmTNnqpyo8/PzKTIykqZMmUIODg7UtWtX+vjjj5UejDgzM5O+/vpr+WsIK1eulA+0rKy8vDz68MMPyd7enl599dU6X04lerr9a9asIRcXFzp27Fid15NKpTRy5EiaO3duncovW7asyqgsz/Lx8anxvufJkycpKCio2uUymYwGDRpEn332WbVloqOjycnJqcoL8eXy8vJo7Nix1KNHD4WveMhkMtq7dy+5ubnRnDlzFD5cdOfOHZo8eTK5uLjQF198UeUSdX5+Pq1bt458fHyoe/futGfPnkrJWiqV0unTp+UPvYwfP56OHz9e6TJvYmJildFiKvYU8/LyaP/+/RQREUH29vbUvXt3+uSTTyg2NrbK/2n5O6UTJkyQv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Rs3kpeXV40998TEROrSpQtNnDix2st+YrGYPvnkE3JwcKDPP/+82vuzp0+fpl69elFAQAAdOHBAYTJNSUmhd999lxwcHGjs2LF07ty5KuWKiopo586dFBISQk5OTvTmm2/SzZs3K5WRyWR0/vx5mj9/Prm6uspHi3m2t5iUlETffPMNDRgwQD4yzNatWxW+GlJefvPmzTRu3Diys7OTzxRy/PhxpZ86ZlVx4mNKycnJoYMHD9LcuXOpdevW5OrqSlOnTqVdu3ZVe8+ruLiYDh8+TDNnziQXFxdq3749LV26lP7991+Vh4OKj4+nt99+W/4awo4dO6od8FkZFy5coJCQEPL19a32pFmbwsJCmjZtGrVr107hkGF1Wb9jx470zTff1HmdoqIisrOzq/ESJtHTy5gmJia11vfff/+Rs7NzrZfcfvvtN/L29q71ZLxmzRry8/Or9kRP9HQbpk2bRh06dKjySkNFd+7coQEDBlCnTp2qffpUJpPRkSNHqHPnztStWzf67bffqh1o/Ntvv6XWrVvTc889R/v27VOYUO/cuUOLFy8mNzc36tmzJ23ZsqXSHIdEVONoMRVlZWXRrl27KDw8nGxsbKhPnz702WefVftksUQioQsXLtDy5cvlc0MOHDiQPvvss0qXWlndceJjNSo/6D766CP5rNflB11ND5o8efKEduzYQWPGjCFra2t6/vnn6YsvvqjxhFabgoIC2rZtG/Xu3ZtcXV1Vfg1Bkfj4eBozZgy5u7vTpk2bVB6R49atW9S+fXuKiIhQ6YEFmUxGkyZNooiICKVOaHv27KGBAwfWWi4rK4tsbGzqVKevr2+dXp8IDw+n9957r9ZyS5cupS5dutR4GVsmk9H69evJ2dm5xp6kTCajHTt2kIuLC82fP7/aJ2ulUin99NNP5OfnR3379q22By2RSOjgwYPUt29fatGiBX3xxRcK21lWVka//PILjRgxgmxtbWnGjBn0999/V/muahotpqKSkhI6evQozZ49m1xdXSkgIIAWL15MFy9erPZHhyo/PlllnPhYFUlJSbRp0yb5ZZYOHTrQW2+9VetllsTERPr6668pJCSErK2tadSoUbRt27ZaX7iuSflrCC+//DLZ2dnJ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nPjqmVdCfGBuYlx7QVavmJsYY16Ij76bwRirA0589UxHT1ssDfODhSl/NYbi6Vidfgj0sNV3UxhjdcBn13ooIsgLS8P8YWFqXOtlT4EAsDA1xvBAtzqVl69Xx7ZoqpxAAJgYCWBqLNDIpVxl6tNmWQtTYx6gmjEDw7Mz1GPXU3OwIfouTt/KgABPX5AuVz4nXD9fJ8wL8UGgh22dyw8McMHJuEc6L1d+KbC2NnZpYQsAuJyco5H6tF2We3qMGRZOfAbgSYEYkZdTkfAwH3klZbA2N4WfmxXGdVE8C3hdy+urXF3Laro+bZdljBkGTnyMMcYaFb7HxxhjrFHhxMcYY6xR4cTHGGOsUeHExxhjrFHhxMcYY6xR4cTHGGOsUeHExxhjrFHhxMcYY6xR4cTHGGOsUfk/6IhxGsMYAwcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "root = single_trace[single_trace['pid'] == 'None']['id'].values[0]\n",
    "pos = hierarchy_pos(G, root=root)    \n",
    "nx.draw(G, pos=pos, with_labels=False)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.6 anm-project",
   "language": "python",
   "name": "anm-project"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
